<template>
  <div class="shopitem" @click="gogoods(list.goods_id)">
    <img v-lazy="list.thumb_url" alt="">
    <div class="info">
      <h5>￥{{(list.price/100).toFixed(2)}}</h5>
      <span >{{list.short_name}}</span>
      <span>oi商城旗舰店</span>
      <div class="but"> <el-button type="danger" size="mini" @click="gogoods(list.goods_id)">查看详情</el-button></div>
    </div>

  </div>
</template>

<script>
export default {
  props: {
      list: {
        type: Object,
        required: true
      }
    },

  methods: {
    gogoods(id) {
      this.$router.replace('/goods/' + id)
    }
  }
}
</script>

<style scoped lang="less">
.shopitem {
  margin-top: 20px;
  height: 200px;
  width: 250px;
  background: #f7f7f7;
  display: flex;
  font-size: 15px;
  position: relative;
  margin-left: 20px;
  margin-right: 40px;

  img {
    margin-top: 30px;
    height: 100px;
    width: 120px;
  }
  .info {
    margin: 30px 5px;
    display: flex;
    flex-direction: column;
    h5 {
      color: #fc5531;
    }
    span {
      margin-top: 10px;
       white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        width: 120px;
    }
    .but {
      position: absolute;
      bottom: 10px;
      right: 10px;
    }
  }
}
</style>